import { useNavigate } from "react-router-dom";
import { QUESTION_EDIT_PATHNAME } from "../router";

function useEditQuestion() {
  const nav = useNavigate();
  function editQuestion(id: string) {
    if (!id) return;

    nav(QUESTION_EDIT_PATHNAME + id);
  }

  return { editQuestion };
}

export default useEditQuestion;
